package com.example.saiweisi.controller.loginController;

import com.example.saiweisi.common.Result;
import com.example.saiweisi.controller.dto.AdminDTO;
import com.example.saiweisi.controller.request.LoginRequest;
import com.example.saiweisi.service.interf.ILoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/login")
@RestController
@CrossOrigin
@Slf4j
public class AdminLoginController{
    @Autowired
    ILoginService loginService;

    @PostMapping("")
    public Result login(@RequestBody LoginRequest request){
        AdminDTO login = loginService.login(request);
        return Result.success(login);
    }
}
